package datastructure;

/**
 * Created with IntelliJ IDEA.
 * Description:
 *
 * @author lzy
 * @create 2019-11-19 下午12:48
 */
public class Power2Test {
    public static void main(String[] args) {
        System.out.println(isPowerOf2(15));
        System.out.println(isPowerOf2(32));
    }

    private static boolean isPowerOf2(int num) {
        return (num & num - 1) == 0;
    }
}
